package cn.iocoder.yudao.module.famous.doctor.dal.mysql.researchgroup;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.famous.doctor.dal.dataobject.researchgroup.ResearchgroupDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.famous.doctor.controller.admin.researchgroup.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 课题组 Mapper
 *
 * @author 档案
 */
@Mapper
public interface ResearchgroupMapper extends BaseMapperX<ResearchgroupDO> {

    default PageResult<ResearchgroupDO> selectPage(ResearchgroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResearchgroupDO>()
                .eqIfPresent(ResearchgroupDO::getIllnessId, reqVO.getIllnessId())
                .betweenIfPresent(ResearchgroupDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(ResearchgroupDO::getEndTime, reqVO.getEndTime())
                .betweenIfPresent(ResearchgroupDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(ResearchgroupDO::getName, reqVO.getName())
                .likeIfPresent(ResearchgroupDO::getIllnessName, reqVO.getIllnessName())
                .orderByDesc(ResearchgroupDO::getId));
    }

    default List<ResearchgroupDO> selectList(ResearchgroupExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ResearchgroupDO>()
                .eqIfPresent(ResearchgroupDO::getIllnessId, reqVO.getIllnessId())
                .betweenIfPresent(ResearchgroupDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(ResearchgroupDO::getEndTime, reqVO.getEndTime())
                .betweenIfPresent(ResearchgroupDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(ResearchgroupDO::getName, reqVO.getName())
                .likeIfPresent(ResearchgroupDO::getIllnessName, reqVO.getIllnessName())
                .orderByDesc(ResearchgroupDO::getId));
    }


    List<ResearchgroupClinicBaseVO> selectclinic(@Param("type")Integer type, @Param("sign")String sign);
}
